﻿#region
using System.Collections.Generic;

#endregion

namespace MidnightPeach.EdmxTransformer
{
    public static class Utility
    {
        public static string GetLastDottedPart(this string text)
        {
            var tokens = text.Split('.');
            return tokens[tokens.Length - 1];
        }

        public static string Get(this Dictionary<string, string> dictionary, string key)
        {
            if (dictionary.ContainsKey(key))
                return dictionary[key];
            return key.GetLastDottedPart();
        }
    }
}